package com.imcode.mapdemo;

import java.util.HashMap;
import java.util.Map;

/**
 * 重写对象的hashcode 和 equals方法
 */
public class HashMapDemo03 {

    public static void main(String[] args) {
        Map<Order,String> map = new HashMap<>();
        map.put(new Order("2019001001"),"订单001");
        map.put(new Order("2019001001"),"订单002");
        System.out.println(map.size());//1
        System.out.println(map.get(new Order("2019001001")));
    }
}
